Left Termination of the query pattern front_in_2(a, g) w.r.t. the given Prolog program could not be shown:



Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof

Clauses:

front(void, []).
front(tree(X, void, void), .(X, [])).
front(tree(X, L, R), Xs) :- ','(front(L, Ls), ','(front(R, Rs), app(Ls, Rs, Xs))).
app([], X, X).
app(.(X, Xs), Ys, .(X, Zs)) :- app(Xs, Ys, Zs).

Queries:

front(a,g).

We use the technique of [30].Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

front_in(tree(X, L, R), Xs) → U1(X, L, R, Xs, front_in(L, Ls))
front_in(tree(X, void, void), .(X, [])) → front_out(tree(X, void, void), .(X, []))
front_in(void, []) → front_out(void, [])
U1(X, L, R, Xs, front_out(L, Ls)) → U2(X, L, R, Xs, Ls, front_in(R, Rs))
U2(X, L, R, Xs, Ls, front_out(R, Rs)) → U3(X, L, R, Xs, app_in(Ls, Rs, Xs))
app_in(.(X, Xs), Ys, .(X, Zs)) → U4(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
app_in([], X, X) → app_out([], X, X)
U4(X, Xs, Ys, Zs, app_out(Xs, Ys, Zs)) → app_out(.(X, Xs), Ys, .(X, Zs))
U3(X, L, R, Xs, app_out(Ls, Rs, Xs)) → front_out(tree(X, L, R), Xs)

The argument filtering Pi contains the following mapping:
front_in(x1, x2)  =  front_in
tree(x1, x2, x3)  =  tree(x2, x3)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
void  =  void
.(x1, x2)  =  .(x2)
[]  =  []
front_out(x1, x2)  =  front_out(x1, x2)
U2(x1, x2, x3, x4, x5, x6)  =  U2(x2, x5, x6)
U3(x1, x2, x3, x4, x5)  =  U3(x2, x3, x5)
app_in(x1, x2, x3)  =  app_in(x1, x2)
U4(x1, x2, x3, x4, x5)  =  U4(x5)
app_out(x1, x2, x3)  =  app_out(x3)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof
  ↳ PrologToPiTRSProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

front_in(tree(X, L, R), Xs) → U1(X, L, R, Xs, front_in(L, Ls))
front_in(tree(X, void, void), .(X, [])) → front_out(tree(X, void, void), .(X, []))
front_in(void, []) → front_out(void, [])
U1(X, L, R, Xs, front_out(L, Ls)) → U2(X, L, R, Xs, Ls, front_in(R, Rs))
U2(X, L, R, Xs, Ls, front_out(R, Rs)) → U3(X, L, R, Xs, app_in(Ls, Rs, Xs))
app_in(.(X, Xs), Ys, .(X, Zs)) → U4(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
app_in([], X, X) → app_out([], X, X)
U4(X, Xs, Ys, Zs, app_out(Xs, Ys, Zs)) → app_out(.(X, Xs), Ys, .(X, Zs))
U3(X, L, R, Xs, app_out(Ls, Rs, Xs)) → front_out(tree(X, L, R), Xs)

The argument filtering Pi contains the following mapping:
front_in(x1, x2)  =  front_in
tree(x1, x2, x3)  =  tree(x2, x3)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
void  =  void
.(x1, x2)  =  .(x2)
[]  =  []
front_out(x1, x2)  =  front_out(x1, x2)
U2(x1, x2, x3, x4, x5, x6)  =  U2(x2, x5, x6)
U3(x1, x2, x3, x4, x5)  =  U3(x2, x3, x5)
app_in(x1, x2, x3)  =  app_in(x1, x2)
U4(x1, x2, x3, x4, x5)  =  U4(x5)
app_out(x1, x2, x3)  =  app_out(x3)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

FRONT_IN(tree(X, L, R), Xs) → U11(X, L, R, Xs, front_in(L, Ls))
FRONT_IN(tree(X, L, R), Xs) → FRONT_IN(L, Ls)
U11(X, L, R, Xs, front_out(L, Ls)) → U21(X, L, R, Xs, Ls, front_in(R, Rs))
U11(X, L, R, Xs, front_out(L, Ls)) → FRONT_IN(R, Rs)
U21(X, L, R, Xs, Ls, front_out(R, Rs)) → U31(X, L, R, Xs, app_in(Ls, Rs, Xs))
U21(X, L, R, Xs, Ls, front_out(R, Rs)) → APP_IN(Ls, Rs, Xs)
APP_IN(.(X, Xs), Ys, .(X, Zs)) → U41(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
APP_IN(.(X, Xs), Ys, .(X, Zs)) → APP_IN(Xs, Ys, Zs)

The TRS R consists of the following rules:

front_in(tree(X, L, R), Xs) → U1(X, L, R, Xs, front_in(L, Ls))
front_in(tree(X, void, void), .(X, [])) → front_out(tree(X, void, void), .(X, []))
front_in(void, []) → front_out(void, [])
U1(X, L, R, Xs, front_out(L, Ls)) → U2(X, L, R, Xs, Ls, front_in(R, Rs))
U2(X, L, R, Xs, Ls, front_out(R, Rs)) → U3(X, L, R, Xs, app_in(Ls, Rs, Xs))
app_in(.(X, Xs), Ys, .(X, Zs)) → U4(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
app_in([], X, X) → app_out([], X, X)
U4(X, Xs, Ys, Zs, app_out(Xs, Ys, Zs)) → app_out(.(X, Xs), Ys, .(X, Zs))
U3(X, L, R, Xs, app_out(Ls, Rs, Xs)) → front_out(tree(X, L, R), Xs)

The argument filtering Pi contains the following mapping:
front_in(x1, x2)  =  front_in
tree(x1, x2, x3)  =  tree(x2, x3)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
void  =  void
.(x1, x2)  =  .(x2)
[]  =  []
front_out(x1, x2)  =  front_out(x1, x2)
U2(x1, x2, x3, x4, x5, x6)  =  U2(x2, x5, x6)
U3(x1, x2, x3, x4, x5)  =  U3(x2, x3, x5)
app_in(x1, x2, x3)  =  app_in(x1, x2)
U4(x1, x2, x3, x4, x5)  =  U4(x5)
app_out(x1, x2, x3)  =  app_out(x3)
FRONT_IN(x1, x2)  =  FRONT_IN
U41(x1, x2, x3, x4, x5)  =  U41(x5)
U31(x1, x2, x3, x4, x5)  =  U31(x2, x3, x5)
U21(x1, x2, x3, x4, x5, x6)  =  U21(x2, x5, x6)
U11(x1, x2, x3, x4, x5)  =  U11(x5)
APP_IN(x1, x2, x3)  =  APP_IN(x1, x2)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

FRONT_IN(tree(X, L, R), Xs) → U11(X, L, R, Xs, front_in(L, Ls))
FRONT_IN(tree(X, L, R), Xs) → FRONT_IN(L, Ls)
U11(X, L, R, Xs, front_out(L, Ls)) → U21(X, L, R, Xs, Ls, front_in(R, Rs))
U11(X, L, R, Xs, front_out(L, Ls)) → FRONT_IN(R, Rs)
U21(X, L, R, Xs, Ls, front_out(R, Rs)) → U31(X, L, R, Xs, app_in(Ls, Rs, Xs))
U21(X, L, R, Xs, Ls, front_out(R, Rs)) → APP_IN(Ls, Rs, Xs)
APP_IN(.(X, Xs), Ys, .(X, Zs)) → U41(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
APP_IN(.(X, Xs), Ys, .(X, Zs)) → APP_IN(Xs, Ys, Zs)

The TRS R consists of the following rules:

front_in(tree(X, L, R), Xs) → U1(X, L, R, Xs, front_in(L, Ls))
front_in(tree(X, void, void), .(X, [])) → front_out(tree(X, void, void), .(X, []))
front_in(void, []) → front_out(void, [])
U1(X, L, R, Xs, front_out(L, Ls)) → U2(X, L, R, Xs, Ls, front_in(R, Rs))
U2(X, L, R, Xs, Ls, front_out(R, Rs)) → U3(X, L, R, Xs, app_in(Ls, Rs, Xs))
app_in(.(X, Xs), Ys, .(X, Zs)) → U4(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
app_in([], X, X) → app_out([], X, X)
U4(X, Xs, Ys, Zs, app_out(Xs, Ys, Zs)) → app_out(.(X, Xs), Ys, .(X, Zs))
U3(X, L, R, Xs, app_out(Ls, Rs, Xs)) → front_out(tree(X, L, R), Xs)

The argument filtering Pi contains the following mapping:
front_in(x1, x2)  =  front_in
tree(x1, x2, x3)  =  tree(x2, x3)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
void  =  void
.(x1, x2)  =  .(x2)
[]  =  []
front_out(x1, x2)  =  front_out(x1, x2)
U2(x1, x2, x3, x4, x5, x6)  =  U2(x2, x5, x6)
U3(x1, x2, x3, x4, x5)  =  U3(x2, x3, x5)
app_in(x1, x2, x3)  =  app_in(x1, x2)
U4(x1, x2, x3, x4, x5)  =  U4(x5)
app_out(x1, x2, x3)  =  app_out(x3)
FRONT_IN(x1, x2)  =  FRONT_IN
U41(x1, x2, x3, x4, x5)  =  U41(x5)
U31(x1, x2, x3, x4, x5)  =  U31(x2, x3, x5)
U21(x1, x2, x3, x4, x5, x6)  =  U21(x2, x5, x6)
U11(x1, x2, x3, x4, x5)  =  U11(x5)
APP_IN(x1, x2, x3)  =  APP_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 2 SCCs with 4 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

APP_IN(.(X, Xs), Ys, .(X, Zs)) → APP_IN(Xs, Ys, Zs)

The TRS R consists of the following rules:

front_in(tree(X, L, R), Xs) → U1(X, L, R, Xs, front_in(L, Ls))
front_in(tree(X, void, void), .(X, [])) → front_out(tree(X, void, void), .(X, []))
front_in(void, []) → front_out(void, [])
U1(X, L, R, Xs, front_out(L, Ls)) → U2(X, L, R, Xs, Ls, front_in(R, Rs))
U2(X, L, R, Xs, Ls, front_out(R, Rs)) → U3(X, L, R, Xs, app_in(Ls, Rs, Xs))
app_in(.(X, Xs), Ys, .(X, Zs)) → U4(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
app_in([], X, X) → app_out([], X, X)
U4(X, Xs, Ys, Zs, app_out(Xs, Ys, Zs)) → app_out(.(X, Xs), Ys, .(X, Zs))
U3(X, L, R, Xs, app_out(Ls, Rs, Xs)) → front_out(tree(X, L, R), Xs)

The argument filtering Pi contains the following mapping:
front_in(x1, x2)  =  front_in
tree(x1, x2, x3)  =  tree(x2, x3)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
void  =  void
.(x1, x2)  =  .(x2)
[]  =  []
front_out(x1, x2)  =  front_out(x1, x2)
U2(x1, x2, x3, x4, x5, x6)  =  U2(x2, x5, x6)
U3(x1, x2, x3, x4, x5)  =  U3(x2, x3, x5)
app_in(x1, x2, x3)  =  app_in(x1, x2)
U4(x1, x2, x3, x4, x5)  =  U4(x5)
app_out(x1, x2, x3)  =  app_out(x3)
APP_IN(x1, x2, x3)  =  APP_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

APP_IN(.(X, Xs), Ys, .(X, Zs)) → APP_IN(Xs, Ys, Zs)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x2)
APP_IN(x1, x2, x3)  =  APP_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

APP_IN(.(Xs), Ys) → APP_IN(Xs, Ys)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ PiDPToQDPProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

FRONT_IN(tree(X, L, R), Xs) → U11(X, L, R, Xs, front_in(L, Ls))
U11(X, L, R, Xs, front_out(L, Ls)) → FRONT_IN(R, Rs)
FRONT_IN(tree(X, L, R), Xs) → FRONT_IN(L, Ls)

The TRS R consists of the following rules:

front_in(tree(X, L, R), Xs) → U1(X, L, R, Xs, front_in(L, Ls))
front_in(tree(X, void, void), .(X, [])) → front_out(tree(X, void, void), .(X, []))
front_in(void, []) → front_out(void, [])
U1(X, L, R, Xs, front_out(L, Ls)) → U2(X, L, R, Xs, Ls, front_in(R, Rs))
U2(X, L, R, Xs, Ls, front_out(R, Rs)) → U3(X, L, R, Xs, app_in(Ls, Rs, Xs))
app_in(.(X, Xs), Ys, .(X, Zs)) → U4(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
app_in([], X, X) → app_out([], X, X)
U4(X, Xs, Ys, Zs, app_out(Xs, Ys, Zs)) → app_out(.(X, Xs), Ys, .(X, Zs))
U3(X, L, R, Xs, app_out(Ls, Rs, Xs)) → front_out(tree(X, L, R), Xs)

The argument filtering Pi contains the following mapping:
front_in(x1, x2)  =  front_in
tree(x1, x2, x3)  =  tree(x2, x3)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
void  =  void
.(x1, x2)  =  .(x2)
[]  =  []
front_out(x1, x2)  =  front_out(x1, x2)
U2(x1, x2, x3, x4, x5, x6)  =  U2(x2, x5, x6)
U3(x1, x2, x3, x4, x5)  =  U3(x2, x3, x5)
app_in(x1, x2, x3)  =  app_in(x1, x2)
U4(x1, x2, x3, x4, x5)  =  U4(x5)
app_out(x1, x2, x3)  =  app_out(x3)
FRONT_IN(x1, x2)  =  FRONT_IN
U11(x1, x2, x3, x4, x5)  =  U11(x5)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
QDP
                    ↳ Narrowing
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

FRONT_INFRONT_IN
U11(front_out(L, Ls)) → FRONT_IN
FRONT_INU11(front_in)

The TRS R consists of the following rules:

front_inU1(front_in)
front_infront_out(tree(void, void), .([]))
front_infront_out(void, [])
U1(front_out(L, Ls)) → U2(L, Ls, front_in)
U2(L, Ls, front_out(R, Rs)) → U3(L, R, app_in(Ls, Rs))
app_in(.(Xs), Ys) → U4(app_in(Xs, Ys))
app_in([], X) → app_out(X)
U4(app_out(Zs)) → app_out(.(Zs))
U3(L, R, app_out(Xs)) → front_out(tree(L, R), Xs)

The set Q consists of the following terms:

front_in
U1(x0)
U2(x0, x1, x2)
app_in(x0, x1)
U4(x0)
U3(x0, x1, x2)

We have to consider all (P,Q,R)-chains.
By narrowing [15] the rule FRONT_INU11(front_in) at position [0] we obtained the following new rules:

FRONT_INU11(U1(front_in))
FRONT_INU11(front_out(void, []))
FRONT_INU11(front_out(tree(void, void), .([])))



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ Narrowing
QDP
                        ↳ NonTerminationProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

FRONT_INU11(U1(front_in))
FRONT_INU11(front_out(void, []))
FRONT_INFRONT_IN
FRONT_INU11(front_out(tree(void, void), .([])))
U11(front_out(L, Ls)) → FRONT_IN

The TRS R consists of the following rules:

front_inU1(front_in)
front_infront_out(tree(void, void), .([]))
front_infront_out(void, [])
U1(front_out(L, Ls)) → U2(L, Ls, front_in)
U2(L, Ls, front_out(R, Rs)) → U3(L, R, app_in(Ls, Rs))
app_in(.(Xs), Ys) → U4(app_in(Xs, Ys))
app_in([], X) → app_out(X)
U4(app_out(Zs)) → app_out(.(Zs))
U3(L, R, app_out(Xs)) → front_out(tree(L, R), Xs)

The set Q consists of the following terms:

front_in
U1(x0)
U2(x0, x1, x2)
app_in(x0, x1)
U4(x0)
U3(x0, x1, x2)

We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.

The TRS P consists of the following rules:

FRONT_INU11(U1(front_in))
FRONT_INU11(front_out(void, []))
FRONT_INFRONT_IN
FRONT_INU11(front_out(tree(void, void), .([])))
U11(front_out(L, Ls)) → FRONT_IN

The TRS R consists of the following rules:

front_inU1(front_in)
front_infront_out(tree(void, void), .([]))
front_infront_out(void, [])
U1(front_out(L, Ls)) → U2(L, Ls, front_in)
U2(L, Ls, front_out(R, Rs)) → U3(L, R, app_in(Ls, Rs))
app_in(.(Xs), Ys) → U4(app_in(Xs, Ys))
app_in([], X) → app_out(X)
U4(app_out(Zs)) → app_out(.(Zs))
U3(L, R, app_out(Xs)) → front_out(tree(L, R), Xs)


s = FRONT_IN evaluates to t =FRONT_IN

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

The DP semiunifies directly so there is only one rewrite step from FRONT_IN to FRONT_IN.




We use the technique of [30].Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

front_in(tree(X, L, R), Xs) → U1(X, L, R, Xs, front_in(L, Ls))
front_in(tree(X, void, void), .(X, [])) → front_out(tree(X, void, void), .(X, []))
front_in(void, []) → front_out(void, [])
U1(X, L, R, Xs, front_out(L, Ls)) → U2(X, L, R, Xs, Ls, front_in(R, Rs))
U2(X, L, R, Xs, Ls, front_out(R, Rs)) → U3(X, L, R, Xs, app_in(Ls, Rs, Xs))
app_in(.(X, Xs), Ys, .(X, Zs)) → U4(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
app_in([], X, X) → app_out([], X, X)
U4(X, Xs, Ys, Zs, app_out(Xs, Ys, Zs)) → app_out(.(X, Xs), Ys, .(X, Zs))
U3(X, L, R, Xs, app_out(Ls, Rs, Xs)) → front_out(tree(X, L, R), Xs)

The argument filtering Pi contains the following mapping:
front_in(x1, x2)  =  front_in
tree(x1, x2, x3)  =  tree(x2, x3)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
void  =  void
.(x1, x2)  =  .(x2)
[]  =  []
front_out(x1, x2)  =  front_out(x1, x2)
U2(x1, x2, x3, x4, x5, x6)  =  U2(x2, x5, x6)
U3(x1, x2, x3, x4, x5)  =  U3(x2, x3, x5)
app_in(x1, x2, x3)  =  app_in(x1, x2)
U4(x1, x2, x3, x4, x5)  =  U4(x2, x3, x5)
app_out(x1, x2, x3)  =  app_out(x1, x2, x3)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

front_in(tree(X, L, R), Xs) → U1(X, L, R, Xs, front_in(L, Ls))
front_in(tree(X, void, void), .(X, [])) → front_out(tree(X, void, void), .(X, []))
front_in(void, []) → front_out(void, [])
U1(X, L, R, Xs, front_out(L, Ls)) → U2(X, L, R, Xs, Ls, front_in(R, Rs))
U2(X, L, R, Xs, Ls, front_out(R, Rs)) → U3(X, L, R, Xs, app_in(Ls, Rs, Xs))
app_in(.(X, Xs), Ys, .(X, Zs)) → U4(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
app_in([], X, X) → app_out([], X, X)
U4(X, Xs, Ys, Zs, app_out(Xs, Ys, Zs)) → app_out(.(X, Xs), Ys, .(X, Zs))
U3(X, L, R, Xs, app_out(Ls, Rs, Xs)) → front_out(tree(X, L, R), Xs)

The argument filtering Pi contains the following mapping:
front_in(x1, x2)  =  front_in
tree(x1, x2, x3)  =  tree(x2, x3)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
void  =  void
.(x1, x2)  =  .(x2)
[]  =  []
front_out(x1, x2)  =  front_out(x1, x2)
U2(x1, x2, x3, x4, x5, x6)  =  U2(x2, x5, x6)
U3(x1, x2, x3, x4, x5)  =  U3(x2, x3, x5)
app_in(x1, x2, x3)  =  app_in(x1, x2)
U4(x1, x2, x3, x4, x5)  =  U4(x2, x3, x5)
app_out(x1, x2, x3)  =  app_out(x1, x2, x3)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

FRONT_IN(tree(X, L, R), Xs) → U11(X, L, R, Xs, front_in(L, Ls))
FRONT_IN(tree(X, L, R), Xs) → FRONT_IN(L, Ls)
U11(X, L, R, Xs, front_out(L, Ls)) → U21(X, L, R, Xs, Ls, front_in(R, Rs))
U11(X, L, R, Xs, front_out(L, Ls)) → FRONT_IN(R, Rs)
U21(X, L, R, Xs, Ls, front_out(R, Rs)) → U31(X, L, R, Xs, app_in(Ls, Rs, Xs))
U21(X, L, R, Xs, Ls, front_out(R, Rs)) → APP_IN(Ls, Rs, Xs)
APP_IN(.(X, Xs), Ys, .(X, Zs)) → U41(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
APP_IN(.(X, Xs), Ys, .(X, Zs)) → APP_IN(Xs, Ys, Zs)

The TRS R consists of the following rules:

front_in(tree(X, L, R), Xs) → U1(X, L, R, Xs, front_in(L, Ls))
front_in(tree(X, void, void), .(X, [])) → front_out(tree(X, void, void), .(X, []))
front_in(void, []) → front_out(void, [])
U1(X, L, R, Xs, front_out(L, Ls)) → U2(X, L, R, Xs, Ls, front_in(R, Rs))
U2(X, L, R, Xs, Ls, front_out(R, Rs)) → U3(X, L, R, Xs, app_in(Ls, Rs, Xs))
app_in(.(X, Xs), Ys, .(X, Zs)) → U4(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
app_in([], X, X) → app_out([], X, X)
U4(X, Xs, Ys, Zs, app_out(Xs, Ys, Zs)) → app_out(.(X, Xs), Ys, .(X, Zs))
U3(X, L, R, Xs, app_out(Ls, Rs, Xs)) → front_out(tree(X, L, R), Xs)

The argument filtering Pi contains the following mapping:
front_in(x1, x2)  =  front_in
tree(x1, x2, x3)  =  tree(x2, x3)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
void  =  void
.(x1, x2)  =  .(x2)
[]  =  []
front_out(x1, x2)  =  front_out(x1, x2)
U2(x1, x2, x3, x4, x5, x6)  =  U2(x2, x5, x6)
U3(x1, x2, x3, x4, x5)  =  U3(x2, x3, x5)
app_in(x1, x2, x3)  =  app_in(x1, x2)
U4(x1, x2, x3, x4, x5)  =  U4(x2, x3, x5)
app_out(x1, x2, x3)  =  app_out(x1, x2, x3)
FRONT_IN(x1, x2)  =  FRONT_IN
U41(x1, x2, x3, x4, x5)  =  U41(x2, x3, x5)
U31(x1, x2, x3, x4, x5)  =  U31(x2, x3, x5)
U21(x1, x2, x3, x4, x5, x6)  =  U21(x2, x5, x6)
U11(x1, x2, x3, x4, x5)  =  U11(x5)
APP_IN(x1, x2, x3)  =  APP_IN(x1, x2)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

FRONT_IN(tree(X, L, R), Xs) → U11(X, L, R, Xs, front_in(L, Ls))
FRONT_IN(tree(X, L, R), Xs) → FRONT_IN(L, Ls)
U11(X, L, R, Xs, front_out(L, Ls)) → U21(X, L, R, Xs, Ls, front_in(R, Rs))
U11(X, L, R, Xs, front_out(L, Ls)) → FRONT_IN(R, Rs)
U21(X, L, R, Xs, Ls, front_out(R, Rs)) → U31(X, L, R, Xs, app_in(Ls, Rs, Xs))
U21(X, L, R, Xs, Ls, front_out(R, Rs)) → APP_IN(Ls, Rs, Xs)
APP_IN(.(X, Xs), Ys, .(X, Zs)) → U41(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
APP_IN(.(X, Xs), Ys, .(X, Zs)) → APP_IN(Xs, Ys, Zs)

The TRS R consists of the following rules:

front_in(tree(X, L, R), Xs) → U1(X, L, R, Xs, front_in(L, Ls))
front_in(tree(X, void, void), .(X, [])) → front_out(tree(X, void, void), .(X, []))
front_in(void, []) → front_out(void, [])
U1(X, L, R, Xs, front_out(L, Ls)) → U2(X, L, R, Xs, Ls, front_in(R, Rs))
U2(X, L, R, Xs, Ls, front_out(R, Rs)) → U3(X, L, R, Xs, app_in(Ls, Rs, Xs))
app_in(.(X, Xs), Ys, .(X, Zs)) → U4(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
app_in([], X, X) → app_out([], X, X)
U4(X, Xs, Ys, Zs, app_out(Xs, Ys, Zs)) → app_out(.(X, Xs), Ys, .(X, Zs))
U3(X, L, R, Xs, app_out(Ls, Rs, Xs)) → front_out(tree(X, L, R), Xs)

The argument filtering Pi contains the following mapping:
front_in(x1, x2)  =  front_in
tree(x1, x2, x3)  =  tree(x2, x3)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
void  =  void
.(x1, x2)  =  .(x2)
[]  =  []
front_out(x1, x2)  =  front_out(x1, x2)
U2(x1, x2, x3, x4, x5, x6)  =  U2(x2, x5, x6)
U3(x1, x2, x3, x4, x5)  =  U3(x2, x3, x5)
app_in(x1, x2, x3)  =  app_in(x1, x2)
U4(x1, x2, x3, x4, x5)  =  U4(x2, x3, x5)
app_out(x1, x2, x3)  =  app_out(x1, x2, x3)
FRONT_IN(x1, x2)  =  FRONT_IN
U41(x1, x2, x3, x4, x5)  =  U41(x2, x3, x5)
U31(x1, x2, x3, x4, x5)  =  U31(x2, x3, x5)
U21(x1, x2, x3, x4, x5, x6)  =  U21(x2, x5, x6)
U11(x1, x2, x3, x4, x5)  =  U11(x5)
APP_IN(x1, x2, x3)  =  APP_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 2 SCCs with 4 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

APP_IN(.(X, Xs), Ys, .(X, Zs)) → APP_IN(Xs, Ys, Zs)

The TRS R consists of the following rules:

front_in(tree(X, L, R), Xs) → U1(X, L, R, Xs, front_in(L, Ls))
front_in(tree(X, void, void), .(X, [])) → front_out(tree(X, void, void), .(X, []))
front_in(void, []) → front_out(void, [])
U1(X, L, R, Xs, front_out(L, Ls)) → U2(X, L, R, Xs, Ls, front_in(R, Rs))
U2(X, L, R, Xs, Ls, front_out(R, Rs)) → U3(X, L, R, Xs, app_in(Ls, Rs, Xs))
app_in(.(X, Xs), Ys, .(X, Zs)) → U4(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
app_in([], X, X) → app_out([], X, X)
U4(X, Xs, Ys, Zs, app_out(Xs, Ys, Zs)) → app_out(.(X, Xs), Ys, .(X, Zs))
U3(X, L, R, Xs, app_out(Ls, Rs, Xs)) → front_out(tree(X, L, R), Xs)

The argument filtering Pi contains the following mapping:
front_in(x1, x2)  =  front_in
tree(x1, x2, x3)  =  tree(x2, x3)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
void  =  void
.(x1, x2)  =  .(x2)
[]  =  []
front_out(x1, x2)  =  front_out(x1, x2)
U2(x1, x2, x3, x4, x5, x6)  =  U2(x2, x5, x6)
U3(x1, x2, x3, x4, x5)  =  U3(x2, x3, x5)
app_in(x1, x2, x3)  =  app_in(x1, x2)
U4(x1, x2, x3, x4, x5)  =  U4(x2, x3, x5)
app_out(x1, x2, x3)  =  app_out(x1, x2, x3)
APP_IN(x1, x2, x3)  =  APP_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

APP_IN(.(X, Xs), Ys, .(X, Zs)) → APP_IN(Xs, Ys, Zs)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x2)
APP_IN(x1, x2, x3)  =  APP_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

APP_IN(.(Xs), Ys) → APP_IN(Xs, Ys)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

FRONT_IN(tree(X, L, R), Xs) → U11(X, L, R, Xs, front_in(L, Ls))
U11(X, L, R, Xs, front_out(L, Ls)) → FRONT_IN(R, Rs)
FRONT_IN(tree(X, L, R), Xs) → FRONT_IN(L, Ls)

The TRS R consists of the following rules:

front_in(tree(X, L, R), Xs) → U1(X, L, R, Xs, front_in(L, Ls))
front_in(tree(X, void, void), .(X, [])) → front_out(tree(X, void, void), .(X, []))
front_in(void, []) → front_out(void, [])
U1(X, L, R, Xs, front_out(L, Ls)) → U2(X, L, R, Xs, Ls, front_in(R, Rs))
U2(X, L, R, Xs, Ls, front_out(R, Rs)) → U3(X, L, R, Xs, app_in(Ls, Rs, Xs))
app_in(.(X, Xs), Ys, .(X, Zs)) → U4(X, Xs, Ys, Zs, app_in(Xs, Ys, Zs))
app_in([], X, X) → app_out([], X, X)
U4(X, Xs, Ys, Zs, app_out(Xs, Ys, Zs)) → app_out(.(X, Xs), Ys, .(X, Zs))
U3(X, L, R, Xs, app_out(Ls, Rs, Xs)) → front_out(tree(X, L, R), Xs)

The argument filtering Pi contains the following mapping:
front_in(x1, x2)  =  front_in
tree(x1, x2, x3)  =  tree(x2, x3)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
void  =  void
.(x1, x2)  =  .(x2)
[]  =  []
front_out(x1, x2)  =  front_out(x1, x2)
U2(x1, x2, x3, x4, x5, x6)  =  U2(x2, x5, x6)
U3(x1, x2, x3, x4, x5)  =  U3(x2, x3, x5)
app_in(x1, x2, x3)  =  app_in(x1, x2)
U4(x1, x2, x3, x4, x5)  =  U4(x2, x3, x5)
app_out(x1, x2, x3)  =  app_out(x1, x2, x3)
FRONT_IN(x1, x2)  =  FRONT_IN
U11(x1, x2, x3, x4, x5)  =  U11(x5)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
QDP
                    ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

FRONT_INFRONT_IN
U11(front_out(L, Ls)) → FRONT_IN
FRONT_INU11(front_in)

The TRS R consists of the following rules:

front_inU1(front_in)
front_infront_out(tree(void, void), .([]))
front_infront_out(void, [])
U1(front_out(L, Ls)) → U2(L, Ls, front_in)
U2(L, Ls, front_out(R, Rs)) → U3(L, R, app_in(Ls, Rs))
app_in(.(Xs), Ys) → U4(Xs, Ys, app_in(Xs, Ys))
app_in([], X) → app_out([], X, X)
U4(Xs, Ys, app_out(Xs, Ys, Zs)) → app_out(.(Xs), Ys, .(Zs))
U3(L, R, app_out(Ls, Rs, Xs)) → front_out(tree(L, R), Xs)

The set Q consists of the following terms:

front_in
U1(x0)
U2(x0, x1, x2)
app_in(x0, x1)
U4(x0, x1, x2)
U3(x0, x1, x2)

We have to consider all (P,Q,R)-chains.
By narrowing [15] the rule FRONT_INU11(front_in) at position [0] we obtained the following new rules:

FRONT_INU11(U1(front_in))
FRONT_INU11(front_out(void, []))
FRONT_INU11(front_out(tree(void, void), .([])))



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ Narrowing
QDP
                        ↳ NonTerminationProof

Q DP problem:
The TRS P consists of the following rules:

FRONT_INU11(U1(front_in))
FRONT_INU11(front_out(void, []))
FRONT_INFRONT_IN
FRONT_INU11(front_out(tree(void, void), .([])))
U11(front_out(L, Ls)) → FRONT_IN

The TRS R consists of the following rules:

front_inU1(front_in)
front_infront_out(tree(void, void), .([]))
front_infront_out(void, [])
U1(front_out(L, Ls)) → U2(L, Ls, front_in)
U2(L, Ls, front_out(R, Rs)) → U3(L, R, app_in(Ls, Rs))
app_in(.(Xs), Ys) → U4(Xs, Ys, app_in(Xs, Ys))
app_in([], X) → app_out([], X, X)
U4(Xs, Ys, app_out(Xs, Ys, Zs)) → app_out(.(Xs), Ys, .(Zs))
U3(L, R, app_out(Ls, Rs, Xs)) → front_out(tree(L, R), Xs)

The set Q consists of the following terms:

front_in
U1(x0)
U2(x0, x1, x2)
app_in(x0, x1)
U4(x0, x1, x2)
U3(x0, x1, x2)

We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.

The TRS P consists of the following rules:

FRONT_INU11(U1(front_in))
FRONT_INU11(front_out(void, []))
FRONT_INFRONT_IN
FRONT_INU11(front_out(tree(void, void), .([])))
U11(front_out(L, Ls)) → FRONT_IN

The TRS R consists of the following rules:

front_inU1(front_in)
front_infront_out(tree(void, void), .([]))
front_infront_out(void, [])
U1(front_out(L, Ls)) → U2(L, Ls, front_in)
U2(L, Ls, front_out(R, Rs)) → U3(L, R, app_in(Ls, Rs))
app_in(.(Xs), Ys) → U4(Xs, Ys, app_in(Xs, Ys))
app_in([], X) → app_out([], X, X)
U4(Xs, Ys, app_out(Xs, Ys, Zs)) → app_out(.(Xs), Ys, .(Zs))
U3(L, R, app_out(Ls, Rs, Xs)) → front_out(tree(L, R), Xs)


s = FRONT_IN evaluates to t =FRONT_IN

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

The DP semiunifies directly so there is only one rewrite step from FRONT_IN to FRONT_IN.